package com.ldkj.panzh.controller;

import com.ldkj.panzh.domain.AjaxResult;
import com.ldkj.panzh.domain.TableDataInfo;
import com.ldkj.panzh.param.ParkingRecordParam;
import com.ldkj.panzh.service.ParkingRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 场内车停车信息查询 控制器
 *
 * @author qiancheng
 * @date 2025-11-19
 */
@Controller
public class ParkingRecordController extends BaseController {

    @Autowired
    ParkingRecordService parkingRecordService;

    /**
     * 查询场内车停车信息
     *
     * @param parkingRecordParam 查询参数
     * @return 停车记录列表
     * @throws Exception
     */
    @RequestMapping("/queryParkingRecords")
    @ResponseBody
    public TableDataInfo queryParkingRecords(@RequestBody ParkingRecordParam parkingRecordParam) throws Exception {
        return getDataTable(parkingRecordService.queryParkingRecords(parkingRecordParam));
    }

    /**
     * 查询场内车统计信息
     *
     * @param parkingRecordParam 查询参数
     * @return 统计数据
     * @throws Exception
     */
    @RequestMapping("/queryParkingStats")
    @ResponseBody
    public AjaxResult queryParkingStats(@RequestBody ParkingRecordParam parkingRecordParam) throws Exception {
        return success(parkingRecordService.queryParkingStats(parkingRecordParam));
    }
}
